package io;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * 对象输出流
 * 可以进行对象的反序列化操作
 */
public class OISDemo {
//    public static void main(String[] args) throws IOException, ClassNotFoundException {
//        FileInputStream fis = new FileInputStream("person.obj");
//        ObjectInputStream ois = new ObjectInputStream(fis);
//
//        Person obj = (Person)ois.readObject();
//        System.out.println(obj);
//
//        ois.close();
//    }
public static void main(String[] args) throws IOException, ClassNotFoundException {
    FileInputStream fis = new FileInputStream("person.obj");
    ObjectInputStream ois = new ObjectInputStream(fis);

    Person obj = (Person)ois.readObject();
    System.out.println(obj);

    ois.close();
}







}
